package com.ying.rabbitmqspringbootconsumer.listener;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.stereotype.Component;

/**
 * ClassName: RabbitMQListener
 * Package: com.ying.rabbitmqspringbootconsumer.listener
 * Description:
 *
 * @Author 刘英杰
 * @Create 2025/5/29 15:23
 * @Version 1.0
 */



@Component
public class RabbitMQListener {
    public static final String QUEUE_USER_NAME = "topicUserQueue";
    public static final String QUEUE_PAY_NAME = "topicPayQueue";

    @RabbitListener(queues = RabbitMQListener.QUEUE_USER_NAME)
    public void userQueueListener(Message message) {
        System.out.println(new String(message.getBody()));
    }

    @RabbitListener(queues = RabbitMQListener.QUEUE_PAY_NAME)
    public void payQueueListener(Message message) {
        System.out.println(new String(message.getBody()));
    }


}
